<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <meta charset="utf-8">
    <title>计算机系学生实习与就业信息系统-登录界面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${ctx}/static/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/static/css/login.css" media="all"/>
</head>
<body>
<div class="video_mask"></div>
<div class="login">
    <h1>用户登录</h1>
    <form class="layui-form" id="login_form" action="${ctx}/login.action" method="post">
        <div class="layui-form-item">
            <input class="layui-input" id="username" name="username" placeholder="用户名" type="text"
                   autocomplete="off" value="${requestScope.username}">
        </div>
        <div class="layui-form-item">
            <input class="layui-input" id="password" name="password" placeholder="密码" type="password"
                   autocomplete="off" value="${requestScope.password}">
        </div>
        <div class="layui-form-item form_code">
            <input class="layui-input" id="code" name="code" placeholder="验证码" type="text"
                   autocomplete="off">
            <div class="code"><img src="${ctx}/getVCode" id="codePic" width="116" height="37" ></div>
        </div>
        <button class="layui-btn login_btn" id="loginBtn">登录</button>
    </form>
</div>
<script type="text/javascript" src="${ctx}/static/layui/layui.js"></script>
<script type="text/javascript" src="${ctx}/static/js/login.js"></script>
<script>
    if (${requestScope.message!=null}) {
        layui.use(['layer','jquery'],function(){
            let layer = parent.layer === undefined ? layui.layer : parent.layer;
            let $ = layui.$;
            layer.msg("${requestScope.message}");
            if (${"验证码错误".equals(requestScope.message)}) {
                $("#code").focus();
            }
        });
    }
</script>
</body>
</html>
